package is.ru.honn.rupin.service;

import is.ru.honn.rupin.data.UserDataGateway;
import is.ru.honn.rupin.domain.User;

import java.util.List;

public interface UserService
{
    /**
     * This functions adds a user to the data source
     * @param user the user
     * @return the newly added user
     * @throws UsernameExistsException
     */
  public User signup(User user) throws UsernameExistsException;

    /**
     * This function logs the user in
     * @param username the username
     * @param password the password
     * @return the user who logged in
     */
  public User login(String username, String password);
  public User getUser(String username);
  public List<User> getUsersByName(String name);

  public void setUserDataGateway(UserDataGateway userDataGateway);
}
